package com.ruijie.acl;


import java.util.ArrayList;
import java.util.List;

import com.ruijie.foundation.bo.EntityObject;

/**
 * <p>
 * Title: ACL组对象
 * </p>
 * <p>
 * Description: 用于数据库中的ACL组管理
 * </p>
 * <p>
 * Copyright: Copyright (c) 2008
 * </p>
 * <p>
 * Company: Ruijie Co., Ltd.
 * </p>
 * <p>
 * Create Time: 2009-09-14
 * </p>
 * <p>
 * Update Time:
 * </p>
 * <p>
 * Updater:
 * </p>
 * <p>
 * Update Comments:
 * </p>
 *@author ASAI
 */
public class AccessGroup extends EntityObject {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 8770132075303413688L;
	// ACL组的类型 
	// standard 标准ACL规则
	// extended 扩展ACL规则
	// mac extended MAC扩展ACL规则
	// expert extended 专家扩展ACL规则
	private String aclType;
	private String name;
	private String remark = "";
	private Boolean isChanged = false;
	private AclDevice aclDevice;
	private List<Ace> aces = new ArrayList<Ace>();
	private Boolean deleteFlg = false;

	public Boolean getDeleteFlg() {
		return deleteFlg;
	}

	public void setDeleteFlg(Boolean deleteFlg) {
		this.deleteFlg = deleteFlg;
	}

	public AccessGroup() {
	}

	public String getAclType() {
		return this.aclType;
	}

	public void setAclType(String aclType) {
		this.aclType = aclType;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Boolean getIsChanged() {
		return this.isChanged;
	}

	public void setIsChanged(Boolean isChanged) {
		this.isChanged = isChanged;
	}

	public List<Ace> getAces() {
		return aces;
	}

	public void setAces(List<Ace> aces) {
		this.aces = aces;
	}

	public AclDevice getAclDevice() {
		return aclDevice;
	}

	public void setAclDevice(AclDevice aclDevice) {
		this.aclDevice = aclDevice;
	}
	
	public AccessGroup clone(AclDevice aclDevice){
		return this.clone(null, aclDevice);
	}
	
	public AccessGroup clone(AccessGroup accessGroup, AclDevice aclDevice){
		AccessGroup entity = accessGroup;
		if (entity == null || 
				(entity.getId() != null && this.getId() != null 
						&& entity.getId().longValue() == this.getId().longValue())){
			entity = new AccessGroup();
		}
		entity.setAclDevice(aclDevice);
		entity.setAclType(this.getAclType());
		entity.setDeleteFlg(this.getDeleteFlg());
		entity.setIsChanged(this.getIsChanged());
		entity.setName(this.getName());
		entity.setRemark(this.getRemark());
		return entity;
	}
}
